Package com.language.dataobjects

Source Code of com.language.dataobjects.Generic

package com.language.dataobjects;

import com.language.datatypes.ArrayType;
import com.language.datatypes.DataType;

public class Generic {
  public String name;
  DataType data_type;
  public Generic(){
    this.name = null;
    data_type = null;
  }
  public Generic(String name){
    this.name = name;
    data_type = new DataType();
  }
  public Generic(String name, String data_type){
    this.name = name;
    this.data_type = new DataType(data_type);
  }
  public Generic(String name, DataType data_type){
    this.name = name;
    this.data_type = data_type;
  }
  public void writeToDB(){
   
  }
  public String toString(){
    String str=this.name + " : " + this.data_type.name;
    if(this.data_type instanceof ArrayType){
      ArrayType at = (ArrayType) this.data_type;
      str +=" RANGE ( "+ at.starting_index + " "+ at.indexing_scheme + " "+ at.ending_index + " );";
    }
    return str;
  }
}
TOP

Related Classes of com.language.dataobjects.Generic

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.